package com.justgame.project.generator.config;

import com.justgame.project.generator.container.EntityContainer;
import com.justgame.project.generator.enums.TemplateType;
import com.justgame.project.generator.schema.Entity;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;
import java.util.List;

@Configuration
public class CodeGeneratorConfig {

    @Bean
    public EntityContainer entityContainer(List<Entity> entities){
        return EntityContainer.builder()
                .entities(entities)
                .coverExistTypes(
                        Arrays.asList(
                                TemplateType.ENTITY,
                                TemplateType.WRAPPER,
                                TemplateType.QUERY,
                                TemplateType.BASIC_SERVICE_INTERFACE
                        ))
                .build();
    }

}
